//
//  UserInfoManager.m
//  LoginAndRegitDemo
//
//  Created by lanou3g on 16/4/25.
//  Copyright © 2016年 浮夸. All rights reserved.
//

#import "UserInfoManager.h"

@implementation UserInfoManager

+ (instancetype)shareManager
{
    static UserInfoManager *manager = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        manager = [UserInfoManager new];
    });
    return manager;
}

- (void)loginWithUserDict:(NSDictionary *)dict
{
    if (dict) {
        [self setValuesForKeysWithDictionary:dict];
    }
}

- (void)setValue:(id)value forKey:(NSString *)key
{
    [super setValue:value forKey:key];
    
    //数据持久化  存储到本地
    [[NSUserDefaults standardUserDefaults]setObject:value forKey:key];
    [[NSUserDefaults standardUserDefaults]synchronize]; //同步
}






@end
